<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'society-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'societyname'); ?>
		<?php echo $form->textField($model,'societyname',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'societyname'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'idblock'); ?>
		<?php
                    $models = Block::model()->findAll(array('order' => 'blockname'));

                    // format models as $key=>$value with listData
                    $list = CHtml::listData($models, 'idblock', 'blockname');
                    echo CHtml::activeDropDownList($model, 'idblock', $list, array('empty' => '(Select a Block'));
                ?>
		<?php //echo $form->textField($model,'idblock',array('size'=>10,'maxlength'=>10)); ?>
		<?php //echo $form->error($model,'idblock'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'societyaddress'); ?>
		<?php echo $form->textField($model,'societyaddress',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'societyaddress'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'societycontact'); ?>
		<?php echo $form->textField($model,'societycontact',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'societycontact'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'societyemail'); ?>
		<?php echo $form->textField($model,'societyemail',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'societyemail'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'societyassistant'); ?>
		<?php echo $form->textField($model,'societyassistant',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'societyassistant'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'assistantcontact'); ?>
		<?php echo $form->textField($model,'assistantcontact',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'assistantcontact'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'assistantemail'); ?>
		<?php echo $form->textField($model,'assistantemail',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'assistantemail'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'assistantaddress'); ?>
		<?php echo $form->textField($model,'assistantaddress',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'assistantaddress'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'remark'); ?>
		<?php echo $form->textField($model,'remark',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'remark'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->